package yxy.cherry.battle.module.actor;

import yxy.cherry.battle.BattleContext;
import yxy.cherry.battle.module.affix.AffixContext;
import yxy.cherry.battle.module.record.Record;
import yxy.cherry.battle.module.record.Recorder;

public abstract class Actor extends Recorder {
	BattleContext context;

	public void setContext(BattleContext context) {
		this.context = context;
	}

	public BattleContext getContext() {
		return context;
	}

	public AffixContext getAffixContext() {
		return context.getAffixContext();
	}

	Actor nextActor;

	public Actor setNextActor(Actor nextActor) {
		this.nextActor = nextActor;
		return this.nextActor;
	}

	public Actor getNextActor() {
		return nextActor;
	}

	public void action() {
		if (canAct()) {
			doAct();
		}
	}

	abstract public void doAct();

	abstract public boolean canAct();

	@Override
	public void transmitRecord(Record record) {
	}
}
